-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
py domain: Ignore aliases for resolving :any:
cross-references
#10089
py domain: Ignore aliases for resolving :any:
cross-references
#10089
Conversation
e9eb629
to
8b8ec94
Compare
8b8ec94
to
29de8ab
Compare
Hm, hey, anyone ? |
@tk0miya if you have any lead as to what I can do to help this PR go forward ? |
sphinx/domains/python.py
Outdated
if len(matches) > 1: | ||
# Remove all duplicated matches | ||
matches = [(name, obj) for name, obj in matches if not obj.aliased] | ||
|
||
for name, obj in matches: | ||
if obj[2] == 'module': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skips a list comprehension step
if len(matches) > 1: | |
# Remove all duplicated matches | |
matches = [(name, obj) for name, obj in matches if not obj.aliased] | |
for name, obj in matches: | |
if obj[2] == 'module': | |
for name, obj in matches: | |
if len(matches) > 1 and obj.aliased: | |
# Skip duplicated matches | |
continue | |
if obj[2] == 'module': |
A
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done (I've stored len(matches) > 1
in a variable)
Please update CHANGES for A |
1d27518
to
8459887
Compare
We should be all good now :) |
8459887
to
85616e5
Compare
Rebased after 5.0 release :) |
(is it expected that the bug label has not been set on the PR ?) |
85616e5
to
4883907
Compare
Rebased after 5.0.1. Also, see #10515 |
4883907
to
4245632
Compare
Oh, I see you added this to the 5.1.0 milestone, I'll update CHANGES so that it appears in the 5.1.0 section :) |
4245632
to
86b89b6
Compare
:any:
cross-references
Thanks @ewjoachim! A |
Subject: closes #10088 (EDIT: already closed as duplicate) and also closes #9577 I believe, since they are duplicates.
With this PR, we can use
:any:
again in Sphinx v4.x with autodoc & python aliases.I believe that everything that used to work will still work
Feature or Bugfix
Purpose
See #10088
The issue is that that autodoc adds
canonical
(which is a good thing), andany
doesn't play well withaliased
objects (which is the bad thing we're solving here)Detail
What I did, it's all in the python domain code:
any
lookups, and the test checks that there is no warning.Just to be sure, I've run the test before the fix and it's red, and after the fix, it's green.
I don't know if this qualifies for a "hotfix" (not sure).
Relates
any
xref resolutions